package com.hulk.boot.common.constant.enums;                                                                                                                              
                                                                                                                                                                                  
                                                                                                                                                                                  
import com.google.common.base.Objects;
                                                                                                                                                                                  
/**                                                                                                                                                                               
 *                                                                                                                                                                                
 * @author    cmt                                                                                                                                                               
 *                                                                                                                                                                                
 */                                                                                                                                                                               
public enum BussErrCode {                                                                                                                                                       
                                                                                                                                                                                  
   
    
	E_P1("P1","发送报文字段非法"),
	E_P2("P2","返回报文字段非法"),
	E_P3("P3","商户终端密钥信息不存在"),
    //E_P10001("P10001","内部交易代码不存在"),
    //E_P10002("P10002","终端信息不存在"),
    //E_P10003("P10003","商户信息不存在"),
    //E_P10004("P10004","商户终端密钥信息不存在"),
    //E_P10005("P10005","8583报文解析失败"),
    // E_P10006("P10006","8583报文拼接失败"),
    //E_P10007("P10007","报文字段非法"),
    

    
    
                                                                                                                                               
    //E_PH("PH","加密机处理失败"),
    E_P5("P5", "数据库非法数据"), 
    E_P6("P6", "数据库非法数据"),                                                                                                                                             

    E_P7("P7", "数据库资源忙"),  
    E_P8("P8", "内部处理超时"),
    E_P9("P9", "内部中心处理异常"),
    E_PP("PP", "未知错误"), ;  
    
                                                                        


    private String errcode;

    public String getErrCode() {
        return errcode;
    }

    public String getErrDesc() {
        return errdesc;
    }

    private String errdesc;

    BussErrCode(String errcode, String errdesc) {
        this.errcode = errcode;
        this.errdesc = errdesc;
    }

    public static String explain(String errcode) {
        for (BussErrCode bussErrorCode : BussErrCode.values()) {
            if (Objects.equal(errcode, bussErrorCode.errcode)) {
                return bussErrorCode.errdesc;
            }
        }
        return errcode;
    }


}
